<include file="./Application/Admin/View/index/nav.html" />
<script type="text/javascript">
	function chk(){
		var title = document.getElementById('b_name');
		var zuozhe = document.getElementById('b_zuozhe');
		var cate = document.getElementById('b_cate');
		if (title.value == '') {
			alert('标题不能为空！');
			return false;
		}
		if (zuozhe.value == '') {
			alert('作者不能为空！');
			return false;
		}
		if (cate.value == '') {
			alert('类别不能为空！');
			return false;
		}
	}
</script>
        <div id="page-wrapper">
        <div class="graphs">
	     <div class="xs">
  	       <h3>添加新书</h3>
  	         <div class="tab-content">
						<div class="tab-pane active" id="horizontal-form">
							<form class="form-horizontal" action="{:U('admin/book/addbook')}" method="post" onsubmit="return chk();">
								<div class="form-group">
									<label for="focusedinput" class="col-sm-2 control-label">标题</label>
									<div class="col-sm-8">
										<input type="text" name="b_name" id="b_name" class="form-control1"  placeholder="标题">
									</div>
								</div>
								<div class="form-group">
									<label for="focusedinput" class="col-sm-2 control-label">作者</label>
									<div class="col-sm-8">
										<input type="text" name="b_zuozhe" id="b_zuozhe" class="form-control1"  placeholder="作者">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">类别</label>
									<div class="col-sm-8">
										<select multiple="" name="b_cate" id="b_cate" class="form-control1">
											<foreach name="cate" item="c">
											<option value="{$c.name}">{$c.name}</option>
											</foreach>
										</select>
									</div>
								</div>
								<div class="form-group">
									<label for="txtarea1" class="col-sm-2 control-label">简介</label>
									<div class="col-sm-8"><textarea name="b_info" id="txtarea1" cols="50" rows="4" style="height: 200px;" class="form-control1"></textarea></div>
								</div>
								<div class="form-group">
									<div class="col-sm-8 col-sm-offset-2">
										<input type="submit" value="添加" class="btn-success btn">
										<input type="reset" value="重置" class="btn-inverse btn">
									</div>
								</div>
							</form>
						</div>
					</div>
  </div>

<include file="./Application/Admin/View/index/footer.html" />